#ifndef ID_H
#define ID_H
#include <QDialog>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QString>
#include "mainwindow.h"
class inputdialog:public QDialog
{
    Q_OBJECT
public:
    inputdialog(int& rn)
    {
        this->setFixedSize(300,120);
        this->setWindowTitle("输入窗口");
        QVBoxLayout *main = new QVBoxLayout;
        qla=new QLabel(tr("请输入随机生成图的顶点个数："));
        ql=new QLineEdit;
        qi=new QPushButton(tr("OK"));
        main->addWidget(qla);
        main->addWidget(ql);
        main->addWidget(qi);
        setLayout(main);
        connect(qi,&QPushButton::clicked,this,[&]()
        {
            QString tn=ql->text();
            rn=tn.toInt();
        });
        connect(qi,&QPushButton::clicked,this,&inputdialog::close);
    }
private:
    QPushButton *qi;
    QLineEdit *ql;
    QLabel *qla;
};
#endif // ID_H
